begintownscript;
variables;
short choice;
body;
beginstate init_state;
	if(get_flag(6,0) == 0) 
	{	if(get_flag(250,0) > 0)
		{	message_dialog("Glup points out a hole in the ground. _Look! This marks the entrance to an old hunting ground of my people. I couldn't explore it before because it was infested by slugs, but I'm sure that you can handle them._","As you descend into the cavern Glup runs his hand along the wall and concludes, _This seems as likely a place to find the shrooms as any. It is damp and dark, unlike the other places I have looked._");
				set_flag(6,0,1); }
		else {
			message_dialog("The ground here has collapsed to reveal a path down into a subterranean pit. You can hear rushing water from within. Perhaps this would be a good place to look for the bog shrooms.","");
			set_flag(6,0,1); }
}
break;

beginstate exit_state;
break;

beginstate start_state;
break;

beginstate 10;
	if(get_flag(6,1) == 0) {
	message_dialog("The stone walls in this cavern are covered in moss and drip slime. It is a very unpleasant location, and the area reeks of decay.","Evidently something has taken up residence here. You spot several massive slugs foraging through the swamps in this room, this cave is a paradise for these creatures, plenty of filth and plants to eat, and dark wet conditions to breed.");
	set_flag(6,1,1);
}
break;

beginstate 11;
	if(get_flag(6,2) == 0) {
		if(get_flag(250,0) == 0)
			message_dialog("The opposite bank of the underground river doesn't appear to be accessible from here. You will have to look elsewhere if you want to hunt more slugs.","");
		else
			message_dialog("The opposite bank of the underground river doesn't appear to be accessible from here. You'll have to find another way around if you want to continue your search for the mushrooms.","");
	set_flag(6,2,1);
}
break;

beginstate 12;
	if(get_flag(6,3) == 0) {
	message_dialog("This cavern appears to be a paradise for giant slugs. The moist air and swampy area make for great living and breading conditions. Unfortunately you doubt this cave holds anything of interest to adventurers except lots of slugs to kill.","");
	set_flag(6,3,1);
}
break;

beginstate 13;
if(get_flag(6,12) == 0)
{	if(char_ok(4) == 0)
	{	message_dialog("This body was dragged here by some denizen of these caves. It looks like a humanoid, but it is too short and its legs are far to large to be human. It is hardly recognizable because acid and decay has removed all external features.","You've seen enough swamp folk by now to recognize this creature to be one. Its gear is ruined, there is nothing else to see here.");
		end(); }
	if(char_ok(4) == 1)
	{	reset_dialog();
		add_dialog_str(0,"This body was dragged here by some denizen of these caves. It looks like a humanoid, but it is too short and its legs are far to large to be human. It is hardly recognizable because acid and decay has removed all external features.",0);
		add_dialog_str(1,"Glup spies the body and rushes over, _This must be one of my tribesmen who died hunting here. It must have been long ago; we haven't hunted here in years and I'm certain I would have remembered if someone had died on a trip._",0);
		add_dialog_str(2,"He sighs, _This body has been here many years, long before I was born I'd think. I never knew this poor soul, but nevertheless he deserves a proper warrior's burial._",0);
		add_dialog_str(3,"Glup gathers the remains, says a few words over them, then places them in the water nearby. You stand in respectful silence.",0);
		add_dialog_str(4,"He turns to you and explains, _Our burial ceremonies are simple, our ancestors came here from the water, when we die we return our bodies to them. I'm glad I could give this man the honor he has earned._",0);
		add_dialog_choice(0,"Ok");
		choice = run_dialog(1);
		if(choice == 1)
		{	set_terrain(45,57,0);
			set_flag(6,12,1); }
}
}
break;

beginstate 14;
	if(get_flag(6,4) == 0) {
		message_dialog("You can see stones just beneath the surface of the water here. It looks like they extend all the way to the other side, so you should be able to cross. You'll have to be careful, they are quite slippery.","");
		set_flag(6,4,1);
}
break;

beginstate 15;
	if(get_flag(6,5) == 0) {
		message_dialog("You were beginning to wonder why this cave was devoid of slugs. Obviously it wasn't. Your footfalls have disturbed this group from their slumber. They rise up from the swamps looking for breakfast. All they see is you._","");
		activate_hidden_group(1);
		set_flag(6,5,1);
}
break;

beginstate 16;
	if(get_flag(6,6) == 0) {
		message_dialog("The acrid smell of decaying plant matter and slug acid that has been assailing your nose throughout these caverns is even worse here. The underground river allowed some air circulation in the rest of the cavern, not so here.","");
		set_flag(6,6,1);
}
break;

beginstate 17;
	if(get_flag(6,7) == 0) {
		message_dialog("You were beginning to wonder if you would ever escape the putrid stench of these caves. You gasp in a breath of fresh air carried down from these waterfalls, and take a moment to admire the view.","A close search reveals stepping stones across this waterfall. If you fall you will most likely be carried downstream and drowned. The life of an adventurer is never easy.");
		set_flag(6,7,1);
}
break;

beginstate 18;
	if(get_flag(6,11) == 0) {
		message_dialog("Eye stalks swivel and focus on you as you enter this cave. Slugs all around cease foraging for food and wallowing in filth to deal with the intruders.","Among the beasts slithering out of the morass is one of the largest slugs you've seen yet. You draw your swords and prepare to finish your business in these caves.");
		activate_hidden_group(2);
		set_flag(6,11,1);
}
break;

beginstate 19;
	if(get_flag(6,10) == 1)
		end();
	if(get_flag(6,10) == 0)
	{	if(char_ok(4) == 1) 
		{	message_dialog("Glup jumps in delight when he sees the mushrooms growing beneath this cave tree. He rushes up and carefully gathers a few. _These are them, the Ocher Bog Shrooms. Now we just need to get them back in time._","");
			change_spec_item(0,1);
			set_flag(6,10,1); }
		else 
		{	message_dialog("This mushroom patch is fairly impressive. They are very large, and could probably feed your party for several days. However, you aren't thinking about food when you pick them; you're fairly sure these are the mushrooms Glup was looking for.","");
			set_flag(6,10,1);
			change_spec_item(0,1); }
}
break;